<template>
	<view class="box">
		<!-- 头部导航 -->
		  <uni-nav-bar background-color="#3286ed" :statusBar="true" :fixed='true' color="#fff" title="待办中心" left-icon="left"   @clickLeft="backFn"  ></uni-nav-bar>
		    <view class="module" style="padding-bottom: 10px;">
		    	<view class="module-item" @click="checkFn(0)">
		    	<uni-icons color="#ff8c2f" custom-prefix="iconfont" type="icon-record" size="30"    class="iconBox" style="font-size: 30px;background-color: #fff8e5;"></uni-icons>
		    	<text    :class="{active:index===0}">提交给我的</text>	 
		    	</view>
				<view class="module-item" @click="checkFn(1)">
				<uni-icons color="#ffca42" custom-prefix="iconfont" type="icon-lingyongshenqing" size="30"    class="iconBox" style="font-size: 30px;background-color: #fff8e5;"></uni-icons>
				<text :class="{active:index===1}"  >抄送给我的</text>	 
				</view>
				<view class="module-item" @click="checkFn(2)">
				<uni-icons color="#38ffd4" custom-prefix="iconfont" type="icon-xinzengruku" size="30"    class="iconBox" style="font-size: 30px;background-color: #fff8e5;"></uni-icons>
				<text :class="{active:index===2}" class="text">我提交的</text>	 
				</view>
		    </view>
			<view style="width: 100%;height: 1px;background-color: #ccc;">
				
			</view>
		   <!-- tbas列表 -->
		   <!-- 提交给我的 -->
		   <view v-show="index===0" class="tome">
			   <u-tabs @click="clickapprovalNu" :list="list1":activeStyle="{ color: '#fd9540',  transform: 'scale(1.05)'}"></u-tabs>
		    <view   class="order">
		    	<!-- 租赁订单 -->
				 <view v-if="orderlistShow" v-for="(item,index) in orderList" :key="index" style="overflow:hidden;background-color: #f2f2f2;">
				 	
					<view style="padding: 10px;height: 100px;margin-top: 10px;background-color: #fff;" class="boxitem" @click="toOrderInfo(item)">
						 <view class="item" style="padding-bottom: 10px;">
						 	项目名称：<span style="font-size: 16px;">{{item.projectName}}</span>
						 </view>
						 <view class="item" style="padding-bottom: 10px;">
						 	创建时间：<span>{{item.createTime.slice(0,11)}}</span>
						 </view>
						 <view class="item" style="padding-bottom: 10px;">
						 	订单编号：<span style="color:#fd9540;">{{item.serialNum}}</span>
						 </view>
				 	</view>
				 </view>
				 <!-- 对账结算单 -->
				 <view v-if="statementListShow" v-for="(item,index) in statementList" :key="index" style="overflow:hidden;background-color: #f2f2f2;">
				 	<view style="padding: 10px;height: 100px;margin-top: 10px;background-color: #fff;" class="boxitem" @click="toStatementInfo(item)">
						 <view class="item" style="padding-bottom: 10px;">
						 	项目名称：<span style="font-size: 16px;">{{item.projectName}}</span>
						 </view>
						 <view class="item" style="padding-bottom: 10px;">
						 	创建时间：<span>{{item.createTime.slice(0,11)}}</span>
						 </view>
						 <view class="item" style="padding-bottom: 10px;">
						 	对账结算单号：<span style="color:#fd9540;">{{item.serialNum}}</span>
						 </view>
				 	</view>
				 </view>
				 <!-- 工程部 -->
				 <view v-if="enginShow" v-for="(item,index) in enginList" :key="index" style="overflow:hidden;background-color: #f2f2f2;">
				 	<view style="padding: 10px;height: 100px;margin-top: 10px;background-color: #fff;" class="boxitem" @click="toEngin(item)">
				 						
										 <view class="item" style="padding-bottom: 10px;">
										 	单号：<span style="color:#fd9540;">{{item.serialNum}}</span>
										 </view>
				 						 <view class="item" style="padding-bottom: 10px;">
				 						 	创建时间：<span>{{item.createTime.slice(0,11)}}</span>
				 						 </view>
										 <view class="item" style="padding-bottom: 10px;">
										 	发起人：<span style="font-size: 16px;">{{item.createBy}}</span>
										 </view>
				 						
				 	</view>
				 </view>
		    </view>
		  
		   </view>
		   <!-- 抄送给我的 -->
		   <view v-show="index===1" class="copyme">
		   <u-tabs @click="clickcopylistNu" :list="list2":activeStyle="{ color: '#fd9540',  transform: 'scale(1.05)'}"></u-tabs>
		  <view   class="order">
		  	<!-- 租赁订单 -->
		  	 <view v-if="copyorderlistShow" v-for="item in copyorderList" style="overflow:hidden;background-color: #f2f2f2;">
		  	 	<view :class="{activen:item.copyerStatus=='1'}" style="padding: 10px;height: 105px;width:100%;margin-top: 10px;background-color: #fff;position:relative" class="boxitem" @click="toOrderInfo(item)">
		  	 		 <view  style="padding-bottom: 10px;">
		  	 		 	项目名称：<span style="font-size: 16px;">{{item.projectName}}</span>
		  	 		 </view>
		  	 		 <view class="item" style="padding-bottom: 10px;">
		  	 		 	创建时间：<span>{{item.createTime.slice(0,11)}}</span>
		  	 		 </view>
		  	 		 <view class="item" style="padding-bottom: 10px;">
		  	 		 	订单编号：<span>{{item.serialNum}}</span>
		  	 		 </view>
					 <view class="item" style="position:absolute;right: 20px;top:10px">
			
						<span v-if="item.copyerStatus=='0'" style="color:#fd9540; " >未读</span>
						<span v-if="item.copyerStatus=='1'" style="color:#e0e0e0;"> 已读</span>                                                                         
					 </view>
		  	 	</view>
		  	 </view>
		  	 <!-- 对账结算单 -->
		  	 <view v-if="copystatementListShow" v-for="item in copystatementList" style="overflow:hidden;background-color: #f2f2f2;">
		  	 	<view :class="{activen:item.copyerStatus=='1'}" style="padding: 10px;height: 100px;margin-top: 10px;background-color: #fff;position:relative" class="boxitem" @click="toStatementInfo(item)">
		  	 		 <view class="item" style="padding-bottom: 10px;">
		  	 		 	项目名称：<span style="font-size: 16px;">{{item.projectName}}</span>
		  	 		 </view>
		  	 		 <view class="item" style="padding-bottom: 10px;">
		  	 		 	创建时间：<span>{{item.createTime.slice(0,11)}}</span>
		  	 		 </view>
		  	 		 <view class="item" style="padding-bottom: 10px;">
		  	 		 	对账结算单号：<span style="color:#fd9540;">{{item.serialNum}}</span>
		  	 		 </view>
					 <view class="item" style="position:absolute;right: 20px;top:10px">
					 	状态：
					 		<span v-if="item.copyerStatus=='0'" style="color:#fd9540;" >未读</span>
					 		<span v-if="item.copyerStatus=='1'" style="color:#f5f5f5;"> 已读</span>
					 </view>
		  	 	</view>
		  	 </view>
		  </view>
		   </view>
		   <!-- 我提交的 -->
		   <view v-if="index===2" class="mine">
		   <u-tabs @click="myCheckFn" :list="list3":activeStyle="{ color: '#fd9540',  transform: 'scale(1.05)'}"></u-tabs>
		   <!-- 租赁订单 -->
		    <view v-if="orderinfoListShow" v-for="item in orderinfoList"  style="overflow:hidden;background-color: #f2f2f2;">
		    	<view style="padding: 10px;height: 100px;margin-top: 10px;background-color: #fff;" class="boxitem" @click="toMyOrderInfo(item)">
		   		 <view class="item" style="padding-bottom: 10px;">
		   		 	项目名称：<span style="font-size: 16px;">{{item.projectName}}</span>
		   		 </view>
		   		 <view class="item" style="padding-bottom: 10px;">
		   		 	创建时间：<span>{{item.createTime.slice(0,11)}}</span>
		   		 </view>
		   		 <view class="item" style="padding-bottom: 10px;">
		   		 	订单编号：<span style="color:#fd9540;">{{item.orderNo}}</span>
		   		 </view>
		    	</view>
		    </view>
			<!-- 出库单 -->
			<view v-if="outinfoListShow" v-for="item in outinfoList"  style="overflow:hidden;background-color: #f2f2f2;">
				<view style="padding: 10px;height: 100px;margin-top: 10px;background-color: #fff;" class="boxitem" @click="toMyOutInfo(item)">
				 <view class="item" style="padding-bottom: 10px;">
				 	项目名称：<span style="font-size: 16px;">{{item.projectName}}</span>
				 </view>
				 <view class="item" style="padding-bottom: 10px;">
				 	创建时间：<span>{{item.createTime.slice(0,11)}}</span>
				 </view>
				 <view class="item" style="padding-bottom: 10px;">
				 	出库单编号：<span style="color:#fd9540;">{{item.outboundNo}}</span>
				 </view>
				</view>
			</view>
			<!-- 回货申请单 -->
			<view v-if="backinfoListShow" v-for="item in backinfoList"  style="overflow:hidden;background-color: #f2f2f2;">
				<view style="padding: 10px;height: 100px;margin-top: 10px;background-color: #fff;" class="boxitem" @click="toMyBackInfo(item)">
				 <view class="item" style="padding-bottom: 10px;">
				 	客户名：<span style="font-size: 16px;">{{item.customerName}}</span>
				 </view>
				 <view class="item" style="padding-bottom: 10px;">
				 	创建时间：<span>{{item.createTime.slice(0,11)}}</span>
				 </view>
				 <view class="item" style="padding-bottom: 10px;">
				 	回货申请单编号：<span style="color:#fd9540;">{{item.returnApplyNo}}</span>
				 </view>
				</view>
			</view>
			<!-- 对账单 -->
			<view v-if="statementinfoListShow" v-for="item in statementinfoList"  style="overflow:hidden;background-color: #f2f2f2;">
				<view style="padding: 10px;height: 100px;margin-top: 10px;background-color: #fff;" class="boxitem" @click="toMyStatementInfo(item)">
				 <view class="item" style="padding-bottom: 10px;">
				 	项目名称：<span style="font-size: 16px;">{{item.projectName}}</span>
				 </view>
				 <view class="item" style="padding-bottom: 10px;">
				 	创建时间：<span>{{item.createTime.slice(0,11)}}</span>
				 </view>
				 <view class="item" style="padding-bottom: 10px;">
				 	对账单编号：<span style="color:#fd9540;">{{item.number}}</span>
				 </view>
				</view>
			</view>
		  <!-- 物流 -->
		   <view v-if="logisiticinfoListShow" v-for="item in logisiticinfoList"  style="overflow:hidden;background-color: #f2f2f2;">
			<view style="padding: 10px;height: 100px;margin-top: 10px;background-color: #fff;" class="boxitem" @click="toMyLogisticsInfo(item)">
			 <view class="item" style="padding-bottom: 10px;">
			 	项目名称：<span style="font-size: 16px;">{{item.projectName}}</span>
			 </view>
			 <view class="item" style="padding-bottom: 10px;">
			 	创建时间：<span>{{item.createTime.slice(0,11)}}</span>
			 </view>
			 <view class="item" style="padding-bottom: 10px;">
			 	订单编号：<span style="color:#fd9540;">{{item.orderNo}}</span>
			 </view>
			</view>
		   </view>
		   <!-- 工程费 -->
	 <view v-if="ebgineeinfoListShow" v-for="item in ebgineeinfoList"  style="overflow:hidden;background-color: #f2f2f2;">
		   			<view style="padding: 10px;height: 100px;margin-top: 10px;background-color: #fff;" class="boxitem" @click="toMyengineeInfo(item)">
		   			 <view class="item" style="padding-bottom: 10px;">
		   			 	项目名称：<span style="font-size: 16px;">{{item.projectName}}</span>
		   			 </view>
		   			 <view class="item" style="padding-bottom: 10px;">
		   			 	创建时间：<span>{{item.createTime.slice(0,11)}}</span>
		   			 </view>
		   			 <view class="item" style="padding-bottom: 10px;">
		   			 	订单编号：<span style="color:#fd9540;">{{item.orderNo}}</span>
		   			 </view>
		   			</view>
		    </view>
		   </view>
		   <u-toast ref="uToast"></u-toast>
	</view>
</template>

<script>
	import {getapprovalRecodeList,editapprovalRecode} from '@/api/approvaRecode.js'
	import {getcopylist,editcopyapi} from '@/api/copy.js'
	import{listOrder} from '@/api/order/order.js'
	import{listHouse} from '@/api/out/out.js'
	import{getBackWarehouseList} from '@/api/backapplication.js'
	import{getStatementListApi} from '@/api/accountStatement.js'
	import{getLogisticsListApi} from '@/api/logistics.js'
	import {listCost} from '@/api/enginee.js'
	export default {
		data() {
			return {
				 
				list1:[
					{
					    name: '租赁订单',
					    badge: {
					        value: 0,
					    }
					},
					{
					    name: '对账结算单',
					    badge: {
					        value: 0,
					    }
					},
					{
					    name: '工程部',
					    badge: {
					        value: 0,
					    }
					},
				],
				list2:[
					{
					    name: '租赁订单',
					    badge: {
					        value: 0,
					    }
					},
					{
					    name: '对账结算单',
					    badge: {
					        value: 0,
					    }
					},
				],
				list3:[
					{
					    name: '租赁订单',
					    badge: {
					        value: 1,
					    }
					},
					{
					    name: '出库单',
					    badge: {
					        value: 0,
					    }
					},
					{
					    name: '回货申请单',
					    badge: {
					        value: 0,
					    }
					},
					{
					    name: '对账结算单',
					    badge: {
					        value: 0,
					    }
					},
					{
					    name: '物流单',
					    badge: {
					        value: 0,
					    }
					},
					{
					    name: '工程费用单',
					    badge: {
					        value: 0,
					    }
					},
				],
				index:0,
				// 提交给我的
				 orderList:[],//订单列表
				 orderlistShow:true,
				 statementList:[],//对账单列表
				 statementListShow:false ,
				 enginList:[],
				 enginShow:false,
				 //抄送给我的
				  copyorderList:[],//订单列表
				  copyorderlistShow:true,
				  copystatementList:[],//对账单列表
				  copystatementListShow:false ,
				  // 我提交的
				  myIndex:0,//我提交的下方tabs序号
				  orderinfoList:[],//订单
				  orderinfoListShow:true,
				  outinfoList:[],//出库单
				  outinfoListShow:false,
				  backinfoList:[],//回货申请单
				  backinfoListShow:false,
				  statementinfoList:[],//对账结算
				  statementinfoListShow:false,
				  logisiticinfoList:[],//物流
				  logisiticinfoListShow:false,
				  ebgineeinfoList:[],//工程
				  ebgineeinfoListShow:false,
				  pageNum:1,
				  pageSize:10,
				  total:0
				 
			};
		},
		onLoad() {
			// 
			this.clickapproval()//提交给我们的
			this.clickcopylist()//抄送给我的
			
		},
		// 上划
		onReachBottom() {
		 if(this.index==0){
			// 提交给我
			if(this.myIndex==0){
				if(this.pageSize * this.pageNum < this.total){
				   this.pageNum++
					 getapprovalRecodeList({serialNum:'ZLDD',approverId:this.$store.getters.userid,approvalStatus:'approve',pageNum:this.pageNum,pageSize:this.pageSize}).then(res=>{				 
						 this.orderList.push(...res.rows)
						                })			  
						     
						
				   }else{
					this.$refs.uToast.show({
						type:"warning",
						message:'别划了，我是有底线的'
					})
				           }
			}else if(this.myIndex==1){
				if(this.pageSize * this.pageNum < this.total){
				   this.pageNum++
					 getapprovalRecodeList({serialNum:'DZ',approverId:this.$store.getters.userid,approvalStatus:'approve',pageNum:this.pageNum,pageSize:this.pageSize}).then(res=>{				 
						 this.orderList.push(...res.rows)
						                })			  
						     
						
				   }else{
					this.$refs.uToast.show({
						type:"warning",
						message:'别划了，我是有底线的'
					})
				           }
			}else if(this.myIndex==2){
				if(this.pageSize * this.pageNum < this.total){
				   this.pageNum++
					 getapprovalRecodeList({serialNum:"GCBGL",approverId:this.$store.getters.userid,approvalStatus:'approve',pageNum:this.pageNum,pageSize:this.pageSize}).then(res=>{				 
						 this.enginList.push(...res.rows)
						                })			  
						     
						
				   }else{
					this.$refs.uToast.show({
						type:"warning",
						message:'别划了，我是有底线的'
					})
				           }
			}
			
			} else if(this.index==1){
			 // 抄送给我的
			 if(this.myIndex==0){
			 	if(this.pageSize * this.pageNum < this.total){
			 	   this.pageNum++
			 		 getcopylist({serialNum:'ZLDD',approverId:this.$store.getters.userid,approvalStatus:'approve',pageNum:this.pageNum,pageSize:this.pageSize}).then(res=>{				 
			 			 this.copyorderList.push(...res.rows)
			 			                })			  
			 			     
			 			
			 	   }else{
			 		this.$refs.uToast.show({
			 			type:"warning",
			 			message:'别划了，我是有底线的'
			 		})
			 	           }
			 }else if(this.myIndex==1){
			 	if(this.pageSize * this.pageNum < this.total){
			 	   this.pageNum++
			 		 getcopylist({serialNum:'DZ',approverId:this.$store.getters.userid,approvalStatus:'approve',pageNum:this.pageNum,pageSize:this.pageSize}).then(res=>{				 
			 			 this.copystatementList.push(...res.rows)
			 			                })			  
			 			     
			 			
			 	   }else{
			 		this.$refs.uToast.show({
			 			type:"warning",
			 			message:'别划了，我是有底线的'
			 		})
			 	           }
			 }
			}else if(this.index==2){
			 // 我提交的
			if(this.myIndex==0){
				// 订单 
			  if(this.pageSize * this.pageNum < this.total){
				this.pageNum++
				listOrder({pageNum:this.pageNum,pageSize:this.pageSize}).then(res=>{
						this.orderinfoList.push(...res.rows)
						this.list3[0].badge.value=this.orderinfoList.length
					           })
				}else{
					this.$refs.uToast.show({
						type:"warning",
						message:'别划了，我是有底线的'
					})
					}
				}else if(this.myIndex==1){
					// 出库单
				if(this.pageSize * this.pageNum < this.total){
				   this.pageNum++
				  listHouse({sponsor:this.$store.getters.userid,sponsorName:this.$store.getters.name,pageNum:this.pageNum,pageSize:this.pageSize}).then(res=>{
				            this.outinfoList.push(...res.rows)
							this.list3[1].badge.value=this.outinfoList.length
									           })
				}else{
				this.$refs.uToast.show({
					type:"warning",
					message:'别划了，我是有底线的'
				})
									}	
				}else if(this.myIndex==2){
					//回货申请单
                 if(this.pageSize * this.pageNum < this.total){
				   this.pageNum++
				 getBackWarehouseList({sponsor:this.$store.getters.userid,sponsorName:this.$store.getters.name,pageNum:this.pageNum,pageSize:this.pageSize}).then(res=>{
				            this.backinfoList.push(...res.rows)
							this.list3[2].badge.value=this.backinfoList.length
									           })
				}else{
				this.$refs.uToast.show({
					type:"warning",
					message:'别划了，我是有底线的'
				})
									}
				}else if(this.myIndex==3){
				if(this.pageSize * this.pageNum < this.total){
				   this.pageNum++
				  getStatementListApi({sponsor:this.$store.getters.userid,sponsorName:this.$store.getters.name,pageNum:this.pageNum,pageSize:this.pageSize}).then(res=>{
				            this.statementinfoList.push(...res.rows)
							this.list3[3].badge.value=this.statementinfoList.length
									           })
				}else{
				this.$refs.uToast.show({
					type:"warning",
					message:'别划了，我是有底线的'
				})
									}	
				}else if(this.myIndex==4){
				if(this.pageSize * this.pageNum < this.total){
				   this.pageNum++
				getLogisticsListApi({sponsor:this.$store.getters.userid,sponsorName:this.$store.getters.name,pageNum:this.pageNum,pageSize:this.pageSize}).then(res=>{
				            this.logisiticinfoList.push(...res.rows)
							this.list3[4].badge.value=this.logisiticinfoList.length
									           })
				}else{
				this.$refs.uToast.show({
					type:"warning",
					message:'别划了，我是有底线的'
				})
									}	
				}else if(this.myIndex==5){
				if(this.pageSize * this.pageNum < this.total){
				   this.pageNum++
				 listCost({sponsor:this.$store.getters.userid,sponsorName:this.$store.getters.name,pageNum:this.pageNum,pageSize:this.pageSize}).then(res=>{
				            this.ebgineeinfoList.push(...res.rows)
							this.list3[5].badge.value=this.ebgineeinfoList.length
									           })
				}else{
				this.$refs.uToast.show({
					type:"warning",
					message:'别划了，我是有底线的'
				})
									}	
				}
			}
		},
		onPullDownRefresh() {
			this.index=0
		    this.clickapproval()
		    setTimeout(() => {
				 
		        uni.stopPullDownRefresh()
		    }, 1000)
		},
		methods:{
			//一级切换
			checkFn(val){
				this.index=val
				if(val==0){
					// 提交给我的
					this.pageNum=1
					this.pageSize=10
					this.total=0
					this.statementList=[]
					this.orderList=[]
					this.clickapproval()
					
				}
				if(val==1){
					// 抄送给我的
					this.pageNum=1
					this.pageSize=10
					this.total=0
					this.copystatementList=[]
					this.copyorderList=[]
					this.clickcopylist()
				}
				if(val==2){
					// 我提交的
					this.pageNum=1
					this.pageSize=10
					this.total=0
					this.orderinfoList=[]
					this.mysendOrderInfo()
				}
				 
			},
			// tabs切换
			async clickapprovalNu(items){
				if(items.index==0){
					this.pageNum=1
					this.pageSize=10
					this.total=0
				  this.myIndex=items.index
				  let res=await getapprovalRecodeList({serialNum:"ZLDD",approverId:this.$store.getters.userid,approvalStatus:'approve',pageNum:this.pageNum,pageSize:this.pageSize})
				  this.total=res.total
				  this.list1[0].badge.value=res.total
				  this.orderList=res.rows
				  this.orderlistShow=true
				  this.enginShow=false
				  this.statementListShow=false
				}
				if(items.index==1){
					this.pageNum=1
					this.pageSize=10
					this.total=0
				  this.myIndex=items.index
				  let res1=await getapprovalRecodeList({serialNum:"DZ",approverId:this.$store.getters.userid,approvalStatus:'approve',pageNum:this.pageNum,pageSize:this.pageSize})
				  this.list1[1].badge.value=res1.total
				  this.total=res1.total
				   this.statementList=res1.rows
				  this.orderlistShow=false
				  this.enginShow=false
				  this.statementListShow=true
				}
				if(items.index==2){
					this.pageNum=1
					this.pageSize=10
					this.total=0
					this.myIndex=items.index
					let res1=await getapprovalRecodeList({serialNum:"GCBGL",approverId:this.$store.getters.userid,approvalStatus:'approve',pageNum:this.pageNum,pageSize:this.pageSize})
					this.list1[2].badge.value=res1.total
					this.total=res1.total
					 this.enginList=res1.rows
					this.statementListShow=false
					this.orderlistShow=false
					this.enginShow=true
				}
			},
			async clickcopylistNu(items){
				if(items.index==0){
					this.pageNum=1
					this.pageSize=10
					this.total=0
					this.myIndex=items.index
					let res=await getcopylist({serialNum:"ZLDD",copyerId:this.$store.getters.userid,pageNum:this.pageNum,pageSize:this.pageSize})
					this.total=res.total
					this.copyorderList=res.rows
					this.list2[0].badge.value=res.total
				  this.copyorderlistShow=true
				  this.copystatementListShow=false
						}
				if(items.index==1){
					this.pageNum=1
					this.pageSize=10
				this.total=0
				 this.myIndex=items.index
				 let res1=await getcopylist({serialNum:"DZ",copyerId:this.$store.getters.userid,pageNum:this.pageNum,pageSize:this.pageSize})
				this.total=res1.total
				 this.list2[1].badge.value=res1.total
				 this.copystatementList=res1.rows
				  this.copyorderlistShow=false
				  this.copystatementListShow=true
						}
			},
			// 提交给我的
			async clickapproval(){
				console.log(this.orderList,this.orderlistShow);
				this.pageNum=1
				this.pageSize=10
				let res=await getapprovalRecodeList({serialNum:"ZLDD",approverId:this.$store.getters.userid,approvalStatus:'approve',pageNum:this.pageNum,pageSize:this.pageSize})
				this.total=res.total
				this.list1[0].badge.value=res.total
				this.orderList=res.rows
				
				let res1=await getapprovalRecodeList({serialNum:"DZ",approverId:this.$store.getters.userid,approvalStatus:'approve',pageNum:this.pageNum,pageSize:this.pageSize})
				this.list1[1].badge.value=res1.total
			    this.statementList=res1.rows
				
				let res2=await getapprovalRecodeList({serialNum:"GCBGL",approverId:this.$store.getters.userid,approvalStatus:'approve',pageNum:this.pageNum,pageSize:this.pageSize})
				this.list1[2].badge.value=res2.total
				this.enginList=res2.rows
				 
			},
			// 抄送给我的
			async clickcopylist(){
				this.pageNum=1
				this.pageSize=10
				let res=await getcopylist({serialNum:"ZLDD",copyerId:this.$store.getters.userid,pageNum:this.pageNum,pageSize:this.pageSize})
				this.total=res.total
				this.copyorderList=res.rows
				this.list2[0].badge.value=res.total
				let res1=await getcopylist({serialNum:"DZ",copyerId:this.$store.getters.userid,pageNum:this.pageNum,pageSize:this.pageSize})
				this.list2[1].badge.value=res1.total
				this.copystatementList=res1.rows
				 
			},
			// 跳转订单详情页面
			toOrderInfo(val){
				uni.navigateTo({
					url:"/pages/order/orderdetails/index?id="+val.orderId
				})
			},
			// 跳转对账结算详情
			toStatementInfo(val){
				uni.navigateTo({
				url:"/pages/accountStatement/StatementInfo/StatementInfo?id="+val.orderId
				})
			},
			toEngin(val){
				uni.navigateTo({
					url:"/pages/ebgineeCost/engineedatial/engineedatial?item="+encodeURIComponent(JSON.stringify(val))
				})
			},
			// 我提交的
			// 订单
	  async mysendOrderInfo(){
	      this.pageNum=1
	     this.pageSize=10
		 this.orderinfoList=[]
	    let res=await listOrder({pageNum:this.pageNum,pageSize:this.pageSize})
	     this.total=res.total
		  this.orderinfoList=res.rows
		   this.list3[0].badge.value=this.orderinfoList.length
			},
			// 出库单
	  async mySendOutInfo(){
		  this.pageNum=1
		 this.pageSize=10
		 this.outinfoList=[]
		let res=await listHouse({sponsor:this.$store.getters.userid,sponsorName:this.$store.getters.name,pageNum:this.pageNum,pageSize:this.pageSize})
		 this.total=res.total
		  this.outinfoList=res.rows
		    this.list3[1].badge.value=this.outinfoList.length
				
			},
			// 回货申请单
      async mySendBackInfo(){
		  this.pageNum=1
		 this.pageSize=10
		 this.backinfoList=[]
		let res=await getBackWarehouseList({sponsor:this.$store.getters.userid,sponsorName:this.$store.getters.name,pageNum:this.pageNum,pageSize:this.pageSize})
		 this.total=res.total
		  this.backinfoList=res.rows
		    this.list3[2].badge.value=this.backinfoList.length
				
			},	
	 // 对账单
	async mySendStatementInfo(){
			  this.pageNum=1
			 this.pageSize=10
			 this.statementinfoList=[]
			let res=await getStatementListApi({sponsor:this.$store.getters.userid,sponsorName:this.$store.getters.name,pageNum:this.pageNum,pageSize:this.pageSize})
			 this.total=res.total
			  this.statementinfoList=res.rows
			    this.list3[3].badge.value=this.statementinfoList.length
					
				}, 
	// 物流
	async mySendLogistiscInfo(){
			this.pageNum=1
			this.pageSize=10
			this.logisiticinfoList=[]
			let res=await getLogisticsListApi({sponsor:this.$store.getters.userid,sponsorName:this.$store.getters.name,pageNum:this.pageNum,pageSize:this.pageSize})
			this.total=res.total
			this.logisiticinfoList=res.rows
			this.list3[4].badge.value=this.logisiticinfoList.length
					
				},
	async mySendEngneeInfo(){
			  this.pageNum=1
			 this.pageSize=10
			 this.ebgineeinfoList=[]
			let res=await listCost({sponsor:this.$store.getters.userid,sponsorName:this.$store.getters.name,pageNum:this.pageNum,pageSize:this.pageSize})
			 this.total=res.total
			  this.ebgineeinfoList=res.rows
			    this.list3[5].badge.value=this.ebgineeinfoList.length
					
				},
		// 我提交的tabs切换
		myCheckFn(item){
			if(item.index==0){
				this.myIndex=item.index
				this.orderinfoListShow=true
				this.outinfoListShow=false
				this.backinfoListShow=false
				this.statementinfoListShow=false
				this.logisiticinfoListShow=false
				this.ebgineeinfoListShow=false
				this.mysendOrderInfo()
				  }
			if(item.index==1){
				this.myIndex=item.index
				this.outinfoListShow=true
				this.orderinfoListShow=false
				this.backinfoListShow=false
				this.statementinfoListShow=false
				this.logisiticinfoListShow=false
				this.ebgineeinfoListShow=false
				this.mySendOutInfo()
				  }
            if(item.index==2){
				this.myIndex=item.index
				this.backinfoListShow=true
				this.orderinfoListShow=false
				this.outinfoListShow=false
				this.statementinfoListShow=false
				this.logisiticinfoListShow=false
				this.ebgineeinfoListShow=false
				this.mySendBackInfo()
				  }	
	    if(item.index==3){
		this.myIndex=item.index
		this.statementinfoListShow=true
		this.backinfoListShow=false
		this.orderinfoListShow=false
		this.outinfoListShow=false
		this.logisiticinfoListShow=false
		this.ebgineeinfoListShow=false
		this.mySendStatementInfo()
		  }	
	if(item.index==4){
	this.myIndex=item.index
	this.logisiticinfoListShow=true
	this.statementinfoListShow=false
	this.backinfoListShow=false
	this.orderinfoListShow=false
	this.outinfoListShow=false
	this.statementinfoListShow=false
	this.ebgineeinfoListShow=false
	this.mySendLogistiscInfo()
	  }
	if(item.index==5){
	this.myIndex=item.index
	this.ebgineeinfoListShow=true
	this.logisiticinfoListShow=false
	this.statementinfoListShow=false
	this.backinfoListShow=false
	this.orderinfoListShow=false
	this.outinfoListShow=false
	this.statementinfoListShow=false
	this.mySendEngneeInfo()
	  }																			
			},
			// 跳转订单页面
			toMyOrderInfo(val){
				uni.navigateTo({
					url:"/pages/order/orderdetails/index?id="+val.id
				})
			},
			// 跳转出库单页面
			toMyOutInfo(val){
				uni.navigateTo({
					url:"/pages/out/outSon/outSon?id='"+val.id
				})
			},
			// 跳转回货申请页面
			toMyBackInfo(val){
				uni.navigateTo({
					url:"/pages/backwarehouse/backwarehouseinfo/backwarehouseinfo?id="+val.id
				})
			},
         // 跳转对账单结算页面
			toMyStatementInfo(val){
				uni.navigateTo({
					url:"/pages/accountStatement/StatementInfo/StatementInfo?id="+val.id
				})
			},
			// 跳转到物流详情
           toMyLogisticsInfo(val){
				uni.navigateTo({
					url:'/pages/logistics/details/index?item='+encodeURIComponent(JSON.stringify(val))
				})
			},
       // 跳转到工程费
	     toMyengineeInfo(val){
			uni.navigateTo({
				url:'/pages/ebgineeCost/engineedatial/engineedatial?item='+encodeURIComponent(JSON.stringify(val))
			}) 
		 },
			backFn(){
				uni.navigateBack({delta:1})
			}
		}
	}
</script>

<style lang="scss">
.box{
	background-color: #ccc;
}
.module{
		display: flex;
		justify-content: space-around;   /* 左对齐 */
		  flex-wrap: wrap;   /* 换行 */
		  background-color: #fff;
	}
	.module-item{
	    width: calc((100% ) / 4);
		display: flex;
		flex-direction: column;
		align-items:center;
		padding: 15px 0;
		
	}
	.active{
		color:#fd9540
	}
	.box {
	    background-color: #fff;
	}
	.list-top {
	    display: flex;
	    justify-content: space-between;
	    border-bottom: solid 1px #c3c3c3;
	    height: 40px;
	    line-height: 40px;
	    padding: 0 10px;
	}
	
	.list-body {
	    font-size: 12px;
	    margin: 10px;
	
	    view {
	        padding: 1px 0;
	    }
	}
	.activen{
		// background-color: #e0e0e0 !important;
		color: #e0e0e0;
	}
	
</style>
